<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>

        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>


        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){


                initThickBox('.thickbox');
                $j('input#leavedate1').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                $j('input#dateStart').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                $j('input#dateEnd').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                   
                $j('.keysearch').live('keyup',function(){
                    if($j('.keysearch').val() == ""){
                        $j('.rich-table-row').show();
                                   
                    }else{
                        $j('.rich-table-row').hide();
                        $j('.rich-table-row').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
   
                // $j(".rich-table-row:odd").addClass("odd");
                $j('.search_box').hide();       
                $j('.sidebar_search').live('click',function(){
                    $j('.search_box').hide();
                    if($j(this).next().hasClass('active')){

                        $j('.search_box').removeClass('active');
                    }else{

                        $j('.search_box').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
                $j(".content_right").live("click",function(){
                    $j('.search_box').hide();
                });
                
                $j(".upWeb").live("click",function(){
                    FV050 = $j(this).attr("lang");
                    FS400 = $j(this).children().attr("lang");

                    $j.post("actionupTouronWeb.jsp?action=checkupweb&FV050="+ FV050,function(data){
                        if(data!=null){
                            window.location= "codeproductTour.jsp?action=detailTour&FS400="+FS400; 
                        }
                    });
                });
                
            });
           
        </script>

    </head>


    <body>

        <a4j:form>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.TOU_TOUR_CAL}'></div>" escape="false"/>
            <div id="content">
                <div id="menutop_top">
                    <div class="div_search_menutop">
                        <div class="item_search">

                            <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" styleClass="text_search" value="#{EmpBean.keySearch}"/>
                            <div style="float:left;border-top: 1px solid #55ACDB;border-bottom: 1px solid #55ACDB;" class="img_search"> <h:graphicImage style="float:left;" value="../images1/arrow_down.png"/></div>
                            <div style="float:left;border: 1px solid #55ACDB;"> <h:graphicImage styleClass="find_all_emp" style="float:left;" value="../images1/btn_search.png"/></div>
                        </div>
                       <%-- <div class="form_search_header">
                            <div class="item_search "><h:outputText value="x" styleClass="close_search" style="font-weight:bold;float:right;margin-right:2.2%;"/></div>
                            <div class="item_search">
                                <table id="table_search">
                                    <tr>
                                        <td class="celltable">
                                            <h:selectOneRadio styleClass="css_radio" value="#{EmpBean.typeSearch}">
                                                <f:selectItem itemValue="2" itemLabel="Họ tên" />

                                                <f:selectItem itemValue="1" itemLabel="Phone" />
                                                <f:selectItem itemValue="3" itemLabel="CMND" />
                                                <f:selectItem itemValue="5" itemLabel="MSNV" />
                                                <f:selectItem itemValue="4" itemLabel="Email" />

                                            </h:selectOneRadio>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td class="celltable">
                                            <h:commandButton action="#{EmpBean.reload}" value="#{locale.search}" styleClass="buttonsearch">
                                            </h:commandButton>
                                        </td>

                                    </tr>
                                </table>

                            </div>
                        </div> --%>
                    </div>
                    <div class="icon_action">
                        <h:panelGroup rendered="#{loginSession.right.TOU_LST_SERV}">
                            <a href="createProduct.jsp?linkhref=<h:outputText value="#{kapiMenu.md5url}"/>"><h:graphicImage value="../images1/back.png"/></a></div>
                        </h:panelGroup>
                </div>

                <div id="menutop">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#">
                                    <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                        <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                        <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                    </span>
                                </a>

                            </div>
                            <div class="select_hidden departmentlistN850">

                                <ul>
                                    <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                                <h:outputText value="Tất cả"/>
                                            </span></a></li>                          


                                    <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                        <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                    <h:outputText value="#{item.label}"/>
                                                </span></a></li> 
                                            </a4j:repeat>
                                </ul>
                            </div>
                        </div>
                    </h:panelGroup>

                </div>

                <div style="width: 100%;float: left;height: 67%;overflow: auto;">
                    <div class="headerdivtable">
                        <div class="itemheaderdivtable_center" style="width: 2%;">
                            <h:outputText value="STT"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="ACTION"/>
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="MÃ TOUR" />
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 25%;">
                            <h:outputText value="SẢN PHẨM TOUR"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 8.2%;">
                            <h:outputText value="QUỐC GIA"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="GIÁ"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="SỐ NGƯỜI"/>
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="NGÀY" />
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="CHUYẾN BAY"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width:6%;">
                            <h:outputText value="NGÀY ĐI"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="CHUYẾN VỀ"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="GIỜ BAY"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="GIỜ ĐẾN"/>
                        </div>



                    </div>

                    <div class="headerdivtable_over">
                        <a4j:repeat  value="#{SPDetailBean.listS400}" var="cus" rowKeyVar="index" >

                            <div class="noteRow headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                <div class="itemheaderdivtable_center" style="width: 2%;">
                                    <h:outputText value="#{index+1}" />
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                 <%--   <h:panelGroup rendered="#{cus.vv051 != ''}">

                                        <div class="upWeb" lang=" <h:outputText value="#{cus.fv050}" />"> <img lang="<h:outputText value="#{cus.fs400}" />" src="../images/www.png" alt="Up wed"  title="Up wed" /></div>
                                        </h:panelGroup> --%>
                                        <h:panelGroup rendered="#{loginSession.right.TOU_CAL_DEL}">

                                        <h:outputLink  rendered="#{cus.vv051 != ''}" value="delete.jsp?id=#{cus.fv050}&id2=#{cus.fs400}&flag=V050FF&width=300&height=150" styleClass="fancybox">
                                            <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                        </h:outputLink>
                                    </h:panelGroup>
                                    <h:panelGroup rendered="#{loginSession.right.TOU_CAL_MOD}">
                                        <h:outputLink rendered="#{cus.vv051!=''}" style="color:white"   value="editcodeproductTour.jsp?action=editV050&FV050=#{cus.fv050}&FS400=#{cus.fs400}&height=5px&width=600px" styleClass="fancybox add_new" id="fancybox34"  >

                                            <img src="../images/edit.png" alt="edit" title="edit"/>
                                        </h:outputLink>
                                    </h:panelGroup>
                                    <h:panelGroup rendered="#{loginSession.right.TOU_CAL_CRE}">
                                        <h:outputLink rendered="#{cus.vv051==''}" value="acceptcodeProductTour.jsp?action=addV050forTour&FS400=#{cus.fs400}&FA000F=#{cus.fa000f}&FA000T=#{cus.fa000t}&inout=#{cus.sn409}&title=#{cus.sv401}&SN408=#{cus.sn408}&SN406=#{cus.sn406}&price=#{cus.sn404}&from=#{cus.kh}&to=#{cus.dd}&datefrom=#{cus.startdate}&dateto=#{cus.backdate}&h1=#{cus.sn102}&h2=#{cus.sn103}&h3=#{cus.sn108}&h4=#{cus.sn109}&width=300&height=150" styleClass="fancybox"  >

                                            <img src="../images/things.png" alt="Mở Tour" title="Mở Tour"/>
                                        </h:outputLink>
                                    </h:panelGroup>
                                </div>

                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                    <h:outputLink value="listTour.jsp?action=linkrecord&fv050=#{cus.fv050}&tabel=T">
                                        <h:outputText value="#{cus.vv051}" />
                                    </h:outputLink>
                                </div>

                                <div class="itemheaderdivtable_left" style="width: 25%;">
                                     <h:panelGroup rendered="#{loginSession.right.TOU_CAL_PRO}"> <a href="productTour.jsp?action=detailTour&FS400=<h:outputText value="#{cus.fs400}" />">  <h:outputText value="#{cus.sv401}" title="Nhấn vào đây thêm sản phẩm Tour này" /></a></h:panelGroup>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 8.2%;">
                                    <h:outputText value="#{cus.dd}" />
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                    <h:outputText value="#{cus.price}" />
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                     <h:outputText value="#{cus.sn408}" />
                                </div>

                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                   <h:outputText value="#{cus.sn406}" />
                                </div>

                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                <h:outputText value="#{cus.sv110}" />
                                </div>
                                <div class="itemheaderdivtable_center" style="width:6%;">
                                   <h:outputText value="#{cus.startdate}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                  <h:outputText value="#{cus.backdate}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                    <h:outputText rendered="#{cus.sn102 < 10}" value="0" /><h:outputText value="#{cus.sn102}:#{cus.sn103}" />
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                   <h:outputText rendered="#{cus.sn108 < 10}" value="0" /><h:outputText value="#{cus.sn108}:#{cus.sn109}" />
                                </div>

                            </div>
                            <div class="noteContent">

                            </div>
                        </a4j:repeat>
                    </div>
                </div>

                <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                 height="30" width="40" zindex="2000">
                    <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                </rich:modalPanel>


                <div class="fotter-page">
                    <jsp:include page="../../common/pagingEmployee.jsp"/>
                </div>
            </div>

        </a4j:form>
    </body>
</html>
